package org.kfive.nova.webservice.client;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * Created by admin on 2017-05-01.
 */
public class UserServiceClient {
    public static void main(String[] args) throws MalformedURLException {
        /*UserWebServiceService factory = new UserWebServiceService();
        UserWebService userWebService = factory.getUserWebServicePort();
        String name = userWebService.getName();
        System.out.println("调用WebService:"+name);*/
        URL serviceUrl = new URL("http://localhost:9091/Service/UserService?wsdl");
        Service service = Service.create(serviceUrl,new QName("http://webservice.nova.kfive.org/","UserWebServiceService"));
        UserWebService userWebService = service.getPort(new QName("http://webservice.nova.kfive.org/","UserWebServicePort"), UserWebService.class);
        String name = userWebService.getName();
        System.out.println("调用WebService:"+name);

    }
}
